<!DOCTYPE html>
<html lang="en">
<head>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Homework_920106840416</title>
    <script type="text/javascript">
        var college = ["计算机学院", "理学院", "外国语学院"];
        var subject = [
            ["计算机科学与技术", "软件工程", "人工智能"],
            ["数学系", "物理学系", "天文学系", "化学系"],
            ["英语系", "日语系", "法语系"],
        ];

        function getcollege() {
            var sltcollege = document.getElementById("college");//获得学院
            sltcollege.length = college.length + 1;
            for (var i = 1; i < sltcollege.length; i++) {
                sltcollege[i].innerHTML = college[i - 1];
                sltcollege[i].value = i;
            }
        }

        function getsubject() {
            var s = document.getElementById("subject");
            var college = document.getElementById("college");
            s.value = 0;
            var s1 = subject[college.value - 1];
            s.length = s1.length + 1;
            for (var i = 1; i < s.length; i++) {
                s[i].innerText = s1[i - 1];
                s[i].value = i;
            }
        }
    </script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        html {
            height: 100%;
        }
        body {
            height: 100%;
        }
        .container {
            height: 100%;
            background-image: linear-gradient(to right, #fbc2eb, #a6c1ee);
        }
        .login-wrapper {
            background-color: #fff;
            width: 358px;
            height: 588px;
            border-radius: 15px;
            padding: 0 50px;
            position: relative;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }
        .header {
            font-size: 38px;
            font-weight: bold;
            text-align: center;
            line-height: 200px;
        }
        .input-item {
            display: block;
            width: 100%;
            margin-bottom: 20px;
            border: 0;
            padding: 10px;
            border-bottom: 1px solid rgb(128, 125, 125);
            font-size: 15px;
            outline: none;
        }
        .btn {
            text-align: center;
            padding: 10px;
            width: 100%;
            margin-top: 40px;
            background-image: linear-gradient(to right, #a6c1ee, #fbc2eb);
            color: #fff;
        }
        .msg {
            text-align: center;
            line-height: 88px;
        }
        a {
            text-decoration-line: none;
            color: #abc1ee;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="login-wrapper">
        <div class="header">Login</div>
        <div class="form-wrapper">
            <form action="LoginController" method="post">
                用户<input type="text" name="username"><br>
                密码<input type="password" name="password"><br>
                验证码<input type="text" name="checkcode">&nbsp;7364<br>
                <label>所在学院</label>
                <select name="college" id="college" onfocus="getcollege()" onchange="getsubject()">
                    <option value="">--请选择--</option>
                </select><br>
                <label>所在系</label>
                <select name="subject" id="subject">
                    <option value="">--请选择--</option>
                </select><br>
                <input type="submit" value="提交">
            </form>
        </div>
        <div class="msg">
            <a href="#">帮助&nbsp;</a>
            <a href="#">忘记密码</a>
        </div>
    </div>
</div>
</body>
</html>

